
import React, { Component } from 'react';
class ClassComp extends Component {
    state = { count: 1 }
    render() {
        return (<div>
            数量：{this.state.count} <br />
            <button onClick={() => { this.setState({ count: ++this.state.count }) }}>+1</button>
        </div>);
    }
}

export default ClassComp;